<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\ModuleModel;
use App\Role;

class MainController extends Controller
{


    //框架拆分

    public function index()
    {
      return view('master');
    }


    public function head()
    {
      return view('main.head');
    }


    public function left()
    {
      $data = ModuleModel::where('deleted_at',null)->orderBy('orderId','asc')->get();
      $user = \Auth::user();
      $roles = Role::findOrFail($user->role_id);
      $modules = explode(",",$roles->modules);
      return view('main.left',compact('data','modules'));
    }


    public function right()
    {
      return view('main');
    }


}
